package com.health.information.service.impl;

import java.util.List;
import com.health.common.utils.DateUtils;
import com.health.common.utils.MinIOUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.health.information.mapper.ContentInformationMapper;
import com.health.information.domain.ContentInformation;
import com.health.information.service.IContentInformationService;
import org.springframework.web.multipart.MultipartFile;

/**
 * 资讯Service业务层处理
 * 
 * @author moxxie
 * @date 2025-11-03
 */
@Service
public class ContentInformationServiceImpl implements IContentInformationService 
{
    @Autowired
    private ContentInformationMapper contentInformationMapper;

    /**
     * 查询资讯
     * 
     * @param articleId 资讯主键
     * @return 资讯
     */
    @Override
    public ContentInformation selectContentInformationByArticleId(Long articleId)
    {
        return contentInformationMapper.selectContentInformationByArticleId(articleId);
    }

    /**
     * 查询资讯列表
     * 
     * @param contentInformation 资讯
     * @return 资讯
     */
    @Override
    public List<ContentInformation> selectContentInformationList(ContentInformation contentInformation)
    {
        return contentInformationMapper.selectContentInformationList(contentInformation);
    }

    /**
     * 新增资讯
     * 
     * @param contentInformation 资讯
     * @return 结果
     */
    @Override
    public int insertContentInformation(ContentInformation contentInformation)
    {
        return contentInformationMapper.insertContentInformation(contentInformation);
    }

    /**
     * 修改资讯
     * 
     * @param contentInformation 资讯
     * @return 结果
     */
    @Override
    public int updateContentInformation(ContentInformation contentInformation)
    {
        contentInformation.setUpdateTime(DateUtils.getNowDate());
        return contentInformationMapper.updateContentInformation(contentInformation);
    }

    /**
     * 批量删除资讯
     * 
     * @param articleIds 需要删除的资讯主键
     * @return 结果
     */
    @Override
    public int deleteContentInformationByArticleIds(Long[] articleIds)
    {
        return contentInformationMapper.deleteContentInformationByArticleIds(articleIds);
    }

    /**
     * 删除资讯信息
     * 
     * @param articleId 资讯主键
     * @return 结果
     */
    @Override
    public int deleteContentInformationByArticleId(Long articleId)
    {
        return contentInformationMapper.deleteContentInformationByArticleId(articleId);
    }

    @Autowired
    private MinIOUtils minIOUtils;


}
